import java.util.Stack;

class MinStack {
    Stack<Integer> stack;
    Stack<Integer> minStack;
    public MinStack() {
        stack=new Stack<>();
        minStack=new Stack<>();
    }

    public void push(int val) {
        stack.push(val);
        if(minStack.empty()){
            minStack.push(val);
        }else{
            if(val<=minStack.peek()){
                minStack.push(val);
            }

        }
    }

    public void pop() {
        if(stack.peek()==minStack.peek()){
            stack.pop();
            minStack.pop();
        }else{
            stack.pop();
        }

    }

    public int top() {
        return stack.pop();
    }

    public int getMin() {
        int val=minStack.pop();
        return val;
    }
}

public class Test {

        Stack<Integer> stack;
        Stack<Integer> minStack;



        public void push(int val) {
            stack.push(val);
            if(minStack.isEmpty()){
                minStack.push(val);
            }else{
                if(val<=minStack.peek()){
                    minStack.push(val);
                }
            }

        }

        public void pop() {

            if(stack.peek()==minStack.peek()){
                stack.pop();
                minStack.pop();
            }else{
                stack.pop();
            }

        }

        public int top() {
            return stack.peek();
        }

        public int getMin() {
            int val=minStack.pop();
            return val;
        }

    public static void main(String[] args) {
  String name="hello";
        for (int i = 0; i < 100; i++) {
            char ch=name.charAt(i);
        }
    }
}
